package b.p.b;

import android.view.View;
import android.view.ViewPropertyAnimator;
import androidx.recyclerview.widget.RecyclerView.z;
import b.p.b.m.a;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Objects;

/* compiled from: DefaultItemAnimator */
public class f implements Runnable {
    public final /* synthetic */ ArrayList a;
    public final /* synthetic */ m b;

    public f(m mVar, ArrayList arrayList) {
        this.b = mVar;
        this.a = arrayList;
    }

    public void run() {
        Iterator it = this.a.iterator();
        while (it.hasNext()) {
            View view;
            a aVar = (a) it.next();
            m mVar = this.b;
            Objects.requireNonNull(mVar);
            z zVar = aVar.a;
            View view2 = null;
            if (zVar == null) {
                view = null;
            } else {
                view = zVar.a;
            }
            z zVar2 = aVar.b;
            if (zVar2 != null) {
                view2 = zVar2.a;
            }
            if (view != null) {
                ViewPropertyAnimator duration = view.animate().setDuration(mVar.f);
                mVar.r.add(aVar.a);
                duration.translationX((float) (aVar.e - aVar.c));
                duration.translationY((float) (aVar.f - aVar.d));
                duration.alpha(0.0f).setListener(new k(mVar, aVar, duration, view)).start();
            }
            if (view2 != null) {
                ViewPropertyAnimator animate = view2.animate();
                mVar.r.add(aVar.b);
                animate.translationX(0.0f).translationY(0.0f).setDuration(mVar.f).alpha(1.0f).setListener(new l(mVar, aVar, animate, view2)).start();
            }
        }
        this.a.clear();
        this.b.n.remove(this.a);
    }
}
